home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group01b.txt / 000100_icon-group-sender_Wed Jul 11 08:44:59 2001.msg < prev    next >
Internet Message Format  |  2002-01-03  |  14KB

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f6BFhlo17444
  4.     for icon-group-addresses; Wed, 11 Jul 2001 08:43:47 -0700 (MST)
  5. Message-Id: <200107111543.f6BFhlo17444@baskerville.CS.Arizona.EDU>
  6. From: icon-project@cs.arizona.edu
  7. X-Newsgroups: comp.lang.icon,comp.answers,news.answers
  8. Subject: Icon Programming Language FAQ
  9. Date: 10 Jul 2001 17:09:39 -0700
  10. To: icon-group@cs.arizona.edu
  11. Errors-To: icon-group-errors@cs.arizona.edu
  12. Status: RO
  13. Content-Length: 13617
  14.  
  15. Archive-name: comp-lang-icon-faq
  16. Posting-Frequency: monthly
  17.  
  18.  
  19.         Frequently Asked Questions about the Icon programming language
  20.                                        
  21.    http://www.cs.arizona.edu/icon/faq.htm
  22.    Last updated June 12, 2001.
  23.    
  24.    Learning about Icon
  25.    A1. What is Icon?
  26.    A2. What is Icon good for?
  27.    A3. What is the Icon program library?
  28.    A4. Where can I learn more about Icon?
  29.    A5. How about comprehensive documentation?
  30.    
  31.    Implementations
  32.    B1. What platforms support Icon?
  33.    B2. How do I get started with Icon?
  34.    B3. Is there a Unicode version of Icon?
  35.    B4. What happened to the compiler?
  36.    
  37.    Administration
  38.    C1. What is the Icon Project?
  39.    C2. How often is the on-line material updated?
  40.    C3. Where did Icon come from?
  41.    C4. Where is Icon going? 
  42.    
  43.    Support
  44.    D1. Is there a users' group for Icon?
  45.    D2. How do I get technical support?
  46.    
  47.    Programming
  48.    E1. Why doesn't read() work with every?
  49.    E2. Why doesn't string invocation such as "foo"() work?
  50.    E3. How can I call a C function?
  51.    E4. Can I open a bidirectional pipe?
  52.      _________________________________________________________________
  53.    
  54. Learning about Icon
  55.  
  56.   A1. What is Icon?
  57.   
  58.    Icon is a very high level general-purpose programming language with
  59.    extensive features for processing strings (text) and data structures.
  60.    Icon is an imperative, procedural language with a syntax that is
  61.    reminiscent of C and Pascal, but with semantics at a much higher
  62.    level.
  63.    
  64.    Icon has a novel expression-evaluation mechanism that integrates
  65.    goal-directed evaluation and backtracking with conventional control
  66.    structures. It has a string scanning facility for pattern matching
  67.    that avoids the tedious details usually associated with analyzing
  68.    strings. Icon's built-in data structures include sets and tables with
  69.    associative lookup, lists that can be used as vectors or stacks and
  70.    queues, and records.
  71.    
  72.    Icon is a strongly, though not statically, typed language. It provides
  73.    transparent automatic type conversion: For example, if an integer is
  74.    used in an operation that requires a string, the integer is
  75.    automatically converted to a string.
  76.    
  77.    Several implementations of Icon have high-level graphics facilities
  78.    with an easily programmed window interface.
  79.    
  80.    Icon manages storage automatically. Objects are created as needed
  81.    during program execution and space is reclaimed by garbage collection
  82.    as needed. The sizes of strings and data structures are limited only
  83.    by the amount of available memory.
  84.    
  85.   A2. What is Icon good for?
  86.   
  87.    As a general-purpose programming language with a large computational
  88.    repertoire, Icon can be used for most programming tasks. It's
  89.    especially strong at building software tools, for processing text, and
  90.    for experimental and research applications.
  91.    
  92.    Icon is designed to make programming easy; it emphasizes the value of
  93.    programmer's time and the importance of getting programs to work
  94.    quickly. Consequently, Icon is used both for short, one-shot tasks and
  95.    for very complex applications.
  96.    
  97.   A3. What is the Icon program library?
  98.   
  99.    The library is a collection of programs and procedures written in
  100.    Icon. User contributions are welcome and form a significant portion of
  101.    the library.
  102.    
  103.    Library procedures effectively augment the built-in functions
  104.    available to an Icon program. A wide variety of procedures currently
  105.    exists, and most graphically-based programs are built around library
  106.    procedures.
  107.    
  108.    The programs in the library range from simple demonstrations to handy
  109.    tools to complex graphical applications.
  110.    
  111.    The library is a resource for both new and experienced programmers. In
  112.    addition to their basic utility, its programs and procedures serve as
  113.    examples of how things can be written in Icon.
  114.    
  115.   A4. Where can I learn more about Icon?
  116.   
  117.    Here are some good places to start.
  118.      * Ralph Griswold's overview:
  119.        http://www.cs.arizona.edu/icon/docs/ipd266.htm
  120.      * Dave Hanson's introduction:
  121.        http://www.cs.arizona.edu/icon/intro.htm
  122.      * John Shipman's tutorial: http://www.nmt.edu/tcc/help/lang/icon/
  123.        
  124.   A5. How about comprehensive documentation?
  125.   
  126.    The definitive work is The Icon Programming Language (third edition)
  127.    by Griswold and Griswold (Peer-to-Peer Communications, 1996). It
  128.    contains both tutorial and reference material.
  129.    
  130.    Graphics facilities are described in Graphics Programming in Icon by
  131.    Griswold, Jeffery, and Townsend (Peer-to-Peer Communications, 1998).
  132.    Again, both tutorial and reference material is included.
  133.    
  134.    Icon's internals are detailed in The Implementation of the Icon
  135.    Programming Language by Griswold and Griswold (Princeton, 1986).
  136.    Remaining copies are available from The Icon Project. Although
  137.    considerable changes have occurred since Version 6, described in the
  138.    book, the basic structure is the same, and technical reports
  139.    describing recent implementation changes are included.
  140.    
  141.    The Icon Programming Language Handbook, by Thomas W. Christopher, is
  142.    available on the web at http://www.toolsofcomputing.com/IconHandbook/.
  143.    
  144.    There is a large amount of additional information at the Icon web
  145.    site, http://www.cs.arizona.edu/icon, but there is no complete on-line
  146.    documentation.
  147.      _________________________________________________________________
  148.    
  149. Implementations
  150.  
  151.   B1. What platforms support Icon?
  152.   
  153.    Current implementations with graphics support are available for Unix
  154.    and Windows. Somewhat older versions, without graphics, are available
  155.    for the Macintosh and other systems. Jcon, an alternative Java-based
  156.    implementation for Unix, is also available. These Icon implementations
  157.    were developed at the University of Arizona, with significant
  158.    contributions from volunteers around the world.
  159.    
  160.   B2. How do I get started with Icon?
  161.   
  162.    Version 9.4 of Icon for Unix can be downloaded from
  163.    http://www.cs.arizona.edu/icon/v940/. Source and binary packages are
  164.    available, each with the complete Icon program library.
  165.    
  166.    Version 9.3 of Icon for Windows is compatible at the source level with
  167.    version 9.4. It can be downloaded from
  168.    http://www.cs.arizona.edu/icon/v93w.htm. The Version 9.4 library can
  169.    be obtained separately from http://www.cs.arizona.edu/icon/v940/.
  170.    
  171.    For older implementations, start at
  172.    http://www.cs.arizona.edu/icon/implver.htm. Jcon is at
  173.    http://www.cs.arizona.edu/icon/jcon/.
  174.    
  175.   B3. Is there a Unicode version of Icon?
  176.   
  177.    No. Icon is defined in terms of 8-bit characters, and changing this
  178.    presents several design challenges that would likely break existing
  179.    programs. Also, modifying the C implementation is probably infeasible,
  180.    but a Unicode version of Jcon might be possible.
  181.    
  182.   B4. What happened to the compiler?
  183.   
  184.    For a while, Unix distributions included both an interpreter and a
  185.    compiler; but the interpreter is is usually fast enough even for
  186.    production work, and most people found that using the compiler wasn't
  187.    worth the extra compilation time or the hassles involved. We no longer
  188.    advertise the compiler or produce binaries for it. It is still part of
  189.    the source code distribution, and we have not deliberately broken it,
  190.    but we no longer support it and we cannot offer help if problems
  191.    arise.
  192.      _________________________________________________________________
  193.    
  194. Administration
  195.  
  196.   C1. What is the Icon Project?
  197.   
  198.    The Icon Project is a name used by the group that distributes and
  199.    supports the Icon programming language. The project maintains the Icon
  200.    web site at http://www.cs.arizona.edu/icon. A non-commercial
  201.    organization, the project derives support from the University of
  202.    Arizona, revenue from book sales, and user contributions.
  203.    
  204.   C2. How often is the on-line material updated?
  205.   
  206.    New material is added when it's available. Established implementations
  207.    usually are updated only when there's a new version. This typically is
  208.    every year or two. The Icon program library is updated on a similar
  209.    schedule.
  210.    
  211.   C3. Where did Icon come from?
  212.   
  213.    Icon is the latest in a series of high-level programming languages
  214.    designed to facilitate programming tasks involving strings and
  215.    structures. The original language, SNOBOL, was developed at Bell
  216.    Telephone Laboratories in the early 1960s. SNOBOL evolved into
  217.    SNOBOL4, which is still in use. Subsequent languages were developed at
  218.    the University of Arizona with support from the National Science
  219.    Foundation. Although it has similar objectives and many similar
  220.    capabilities, Icon bears little superficial resemblance to SNOBOL4.
  221.    
  222.    The name Icon is not an acronym, nor does it stand for anything in
  223.    particular, although the word iconoclastic was mentioned when the name
  224.    was chosen. The name predates the now common use of icon to refer to
  225.    small images used in graphical user interfaces. This sometimes
  226.    misleads people into thinking that that Icon is designed to create or
  227.    manipulate icons, but there's no good solution to that problem.
  228.    
  229.   C4. Where is Icon going?
  230.   
  231.    We continue to use Icon on a daily basis, but no significant changes
  232.    are planned. We expect to support the Unix version for the forseeable
  233.    future, and to distribute ports to other systems as supplied by
  234.    volunteers.
  235.    
  236.    The Unicon project is developing an object-oriented language based on
  237.    Icon. For more information, see http://unicon.sourceforge.net. An
  238.    earlier object-oriented extension to Icon, Idol, can be found in the
  239.    Icon program library.
  240.      _________________________________________________________________
  241.    
  242. Support
  243.  
  244.   D1. Is there a users' group for Icon?
  245.   
  246.    There is no official Icon users' group, but The Icon Project maintains
  247.    a moderated "Icon-group" electronic mailing list. To subscribe (or
  248.    unsubscribe), send a message to icon-group-request@cs.arizona.edu.
  249.    
  250.    There is a gateway between Icon-group and comp.lang.icon, an
  251.    unmoderated newsgroup for discussing issues related to Icon. The
  252.    gateway, which exchanges messages between the two systems, is
  253.    imperfect and not under the control of the Icon Project.
  254.    
  255.    The newsgroup generally provides faster response than the mailing list
  256.    and is less intrusive, but it sometimes suffers from inappropriate
  257.    postings. The Icon Project usually sends its announcements and other
  258.    messages to the mailing list.
  259.    
  260.   D2. How do I get technical support?
  261.   
  262.    The Icon Project is not a commercial organization, and its capacity
  263.    for providing technical support is limited. Please use the appropriate
  264.    resource when you need assistance:
  265.      * For programming assistance, submit a query to the mailing list or
  266.        newsgroup (see above).
  267.      * For porting assistance or Unix problems, contact
  268.        icon-project@cs.arizona.edu.
  269.      * For problems with the Windows implementation, contact the
  270.        implementor, jeffery@cs.unlv.edu.
  271.      * For general information, additional documentation, or mail orders,
  272.        visit the Icon web site: http://www.cs.arizona.edu/icon.
  273.      _________________________________________________________________
  274.    
  275. Programming
  276.  
  277.   E1. Why doesn't read() work with every?
  278.   
  279.    every s := read() do {...} doesn't loop because read() produces a
  280.    single value and then fails if resumed. Other "consumer" procedures
  281.    such as get() and pop() work the same way. Use a while loop with these
  282.    procedures, and save every for use with generators such as !x or
  283.    key(T).
  284.    
  285.   E2. Why doesn't string invocation such as "foo"() work?
  286.   
  287.    String invocation works if the procedure is present; the catch is that
  288.    the linker removes unreferenced procedures. To ensure a procedure's
  289.    presence, reference it in the main() procedure. A simple reference
  290.    suffices, as in refs := [foo, bar, baz]; it's not necessary to
  291.    actually call it.
  292.    
  293.    (Why does the linker remove unreferenced procedures? Because this can
  294.    save huge amounts of memory for programs that use the library.)
  295.    
  296.   E3. How can I call a C function?
  297.   
  298.    You can't call an arbitrary C function, but if you're willing to write
  299.    a function to Icon's specifications, there are two approaches. Under
  300.    Unix, which provides loadfunc(), you can load one or more functions
  301.    from a shared library, and afterwards treat them as if they had been
  302.    written in Icon. Some examples can be found in the cfuncs and
  303.    packs/loadfuncs directories of the Icon program library. The more
  304.    cumbersome approach is to add code to the Icon interpreter and rebuild
  305.    it; some hooks are provided for this purpose. Both approaches are
  306.    discussed in Calling C Functions from Icon,
  307.    http://www.cs.arizona.edu/icon/docs/ipd240.htm.
  308.    
  309.    The Jcon implementation allows Icon programs to call Java code that is
  310.    written to Jcon specifications.
  311.    
  312.   E4. Can I open a bidirectional pipe?
  313.   
  314.    No, this is not possible. Although the concept is simple -- write a
  315.    line to a program via a pipe, then read that program's output -- it
  316.    probably wouldn't work. Most I/O libraries don't write anything to a
  317.    pipe until they've filled a buffer, and the most likely consequence
  318.    would be a deadlock, with each program waiting for the other to send
  319.    more data.
  320.      _________________________________________________________________
  321.    
  322.    This FAQ is edited by Gregg Townsend, with contributions from Ralph
  323.    Griswold, Cliff Hathaway, Clint Jeffery, Bob Alexander, and Todd
  324.    Proebsting.
  325.